arr = [5, 3, 2, 6, 11, 1, 0, -1]
length = 8

sorted = False
while not sorted:
    sorted = True
    end = length - 1
    for i in range(end):
        if arr[i] > arr[i + 1]:
            temp = arr[i]
            arr[i] = arr[i + 1]
            arr[i + 1] = temp
            sorted = False
for i in range(length):
    print arr[i],